package xin.yangshuai.shardingsphere01.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xin.yangshuai.shardingsphere01.dao.ShardingsphereTestUserMapper;
import xin.yangshuai.shardingsphere01.model.ShardingsphereTestUser;

import java.util.List;

@RestController
public class IndexController {

    @Autowired
    private ShardingsphereTestUserMapper shardingsphereTestUserMapper;

    @RequestMapping
    public String index() {
        return "hello world shardingsphere";
    }

    @RequestMapping("list")
    public List<ShardingsphereTestUser> list() {
        return shardingsphereTestUserMapper.selectByExample(null);
    }
}